-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Compatibility Preparation #2
base: master
Are you sure you want to change the base?
Conversation
const OSPathSeparator = Platform.select({ | ||
ios: "/", | ||
android: "/", | ||
windows: "\\", | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to use path
? if so you can just use path.sep
if you need access to the separator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so as it's React-Native JS world and not node.js?
const resolvePath = (...paths: Array<string>) => { | ||
if (Platform.OS === "windows") { | ||
return paths | ||
.join(OSPathSeparator) | ||
.split(OSPathSeparator) | ||
.filter((part) => part && part !== ".") | ||
.join(OSPathSeparator); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're able to use path
then I think this is the same as path.normalize
with a trailing separator?
Hey there!
I've been using your fork for some time now and thought I may contribute something small back ;-).
I've made some small changes to the index.js to prepare for Windows paths compatibility.
I'll remove the changes to yarn.lock and package.json if you'd be fine with merging the index.js changes.
The RN-FS windows support PR should merged rather sooner than later and this would prepare the Library for it.
Have already tested on Android & Windows & iOS